package com.card.demo;

public class GoldCard extends  card {
    public GoldCard(String cardId, String name, String Phone, double money) {
        super(cardId, name, Phone, money);
    }

    public GoldCard() {
    }

    @Override
    public void shopMoney(double money) {
        System.out.println("使用金卡购物");
        double shoppedMoney = money*0.8;
        System.out.println("购物成功，实际支付："+shoppedMoney);
        if (shoppedMoney<=getMoney())
        {
            setMoney(getMoney()-shoppedMoney);
            printPaper( money);
        }else
        {
         System.out.println("余额不足");
        }

    }
    public void printPaper(double money)
    {
        if (money>200)
        {
            System.out.println("使用金卡打印,可以进行一次免费的洗车");
        }
        else {
            System.out.println("使用普卡打印");
        }
    }
}
